﻿<%@ Page Title="Settings" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Settings.aspx.cs" Inherits="ColorApplication.color.Settings" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1 {
            height: 23px;
            vertical-align: top;
        }

        input, select, textarea {
            font-family: Arial,Helvetica,sans-serif;
            font-size: 12px;
        }
    </style>
    <script>
        function checkTextAreaMaxLength(textBox, e, length) {

            var mLen = textBox["MaxLength"];
            if (null == mLen)
                mLen = length;

            var maxLength = parseInt(mLen);
            if (!checkSpecialKeys(e)) {
                if (textBox.value.length > maxLength - 1) {
                    if (window.event)//IE
                        e.returnValue = false;
                    else//Firefox
                        e.preventDefault();
                }
            }
        }
        function checkSpecialKeys(e) {
            if (e.keyCode != 8 && e.keyCode != 46 && e.keyCode != 37 && e.keyCode != 38 && e.keyCode != 39 && e.keyCode != 40)
                return false;
            else
                return true;
        }
    </script>
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <div class="adminContent">
        <h2>Settings</h2>
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
            <ProgressTemplate>
                <div id="modalPage" runat="server" class="modalPage">
                    <div class="modalBackground">
                    </div>
                    <div class="modalContainer">
                        <div class="modal">
                            <table>
                                <tr>
                                    <td align="center">
                                        <div style="background-color: White; border-radius: 5px; color: black; height: 47px;
                                            padding-top: 5px;">
                                            Please Wait...
                                            <br />
                                            <img src="../Images/preloader.gif" />
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Label ID="ErrorLabel" runat="server" CssClass="failureNotification"></asp:Label>
                <asp:Label ID="SuccesLabel" runat="server" CssClass="successNotification"></asp:Label>
                <table>
                    <tr>
                        <td colspan="3" align="left">
                            <asp:Label ID="ColorPercentageLabel" runat="server" Text="Max. White Color%" />
                        </td>
                        <td align="left">
                            <asp:TextBox ID="ColorPercentagetextBox" runat="server" />
                            <asp:FilteredTextBoxExtender ID="ColorPercentagetextBox_FilteredTextBoxExtender"
                                runat="server" Enabled="True" FilterMode="ValidChars" TargetControlID="ColorPercentagetextBox"
                                ValidChars="1234567890.">
                            </asp:FilteredTextBoxExtender>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Max. White Color% is required"
                                CssClass="failureNotification" ControlToValidate="ColorPercentagetextBox" Display="Dynamic"
                                SetFocusOnError="True" ValidationGroup="Settings"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="ColorPercentagetextBox"
                                CssClass="failureNotification" Display="Dynamic" ErrorMessage="Value must be less than or equal to 100 and should have max 2 decimal digit"
                                SetFocusOnError="True" ValidationExpression="^100(\.0{0,2}?)?$|^\d{0,2}(\.\d{0,2})?$"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" class="style1" align="left">
                            <asp:Label ID="ResultPercentageLabel" runat="server" Text="Reduce White Color% By" />
                        </td>
                        <td class="style1" align="left">
                            <asp:TextBox ID="ResultPercentagetextBox" runat="server" />
                            <asp:FilteredTextBoxExtender ID="ResultPercentagetextBox_FilteredTextBoxExtender"
                                runat="server" Enabled="True" FilterMode="ValidChars" TargetControlID="ResultPercentagetextBox"
                                ValidChars="1234567890.">
                            </asp:FilteredTextBoxExtender>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Reduce White Color% is required"
                                CssClass="failureNotification" ControlToValidate="ResultPercentagetextBox" Display="Dynamic"
                                SetFocusOnError="True" ValidationGroup="Settings"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="ResultPercentagetextBox"
                                CssClass="failureNotification" Display="Dynamic" ErrorMessage="Value must be less than or equal to 100 and should have max 2 decimal digit"
                                SetFocusOnError="True" ValidationExpression="^100(\.0{0,2}?)?$|^\d{0,2}(\.\d{0,2})?$"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" class="style1" align="left">
                            <asp:Label ID="DominantAttributesFactorLabel" runat="server" Text="Dominant Attributes Factor" />
                        </td>
                        <td class="style1" align="left">
                            <asp:TextBox ID="DominantAttributesFactortextBox" runat="server" />
                            <asp:FilteredTextBoxExtender ID="DominantAttributesFactortextBox_FilteredTextBoxExtender"
                                runat="server" Enabled="True" TargetControlID="DominantAttributesFactortextBox"
                                ValidChars="1234567890.">
                            </asp:FilteredTextBoxExtender>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Dominant Attributes Factor is required"
                                CssClass="failureNotification" ControlToValidate="DominantAttributesFactortextBox"
                                Display="Dynamic" SetFocusOnError="True" ValidationGroup="Settings"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" class="style1" align="left">
                            <asp:Label ID="Label1" runat="server" Text="Use Offset" />
                        </td>
                        <td class="style1" align="left">
                            <asp:DropDownList ID="ddlUseOffset" runat="server" Width="142px">
                                <asp:ListItem>Select</asp:ListItem>
                                <asp:ListItem>True</asp:ListItem>
                                <asp:ListItem>False</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" class="style1" align="center">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Use Offset is required"
                                CssClass="failureNotification" ControlToValidate="ddlUseOffset" Display="Dynamic"
                                SetFocusOnError="True" ValidationGroup="Settings" InitialValue="Select"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" class="style1" colspan="3">
                            <asp:Label ID="Label2" runat="server" Text="Common Message" />
                        </td>
                        <td align="left" class="style1">
                            <asp:TextBox Rows="5" Columns="35" ID="txtCommonMessage" MaxLength='250' onkeyDown="checkTextAreaMaxLength(this,event,'250');"
                                TextMode="multiLine" runat="server"> </asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" class="style1" colspan="4">&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="left" class="style1" colspan="3">
                            <asp:Label ID="Label3" runat="server" 
                                Text="Maximum Attribute Families to Include" />
                        </td>
                        <td align="left" class="style1">
                            <asp:TextBox ID="MaximumAttributeFamiliesToInclude" runat="server" />
                            <asp:FilteredTextBoxExtender ID="MaximumAttributeFamiliesToInclude_FilteredTextBoxExtender" 
                                runat="server" Enabled="True" FilterMode="ValidChars" 
                                TargetControlID="MaximumAttributeFamiliesToInclude" ValidChars="1234567890">
                            </asp:FilteredTextBoxExtender>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" class="style1" colspan="4">&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="left" class="style1" colspan="3">
                            <asp:Label ID="Label4" runat="server" 
                                Text="Minimum Attribute Family Percentage" />
                        </td>
                        <td align="left" class="style1">
                            <asp:TextBox ID="MinimumAttributeFamilyPercentage" runat="server" />
                            <asp:FilteredTextBoxExtender ID="MinimumAttributeFamilyPercentage_FilteredTextBoxExtender" 
                                runat="server" Enabled="True" FilterMode="ValidChars" 
                                TargetControlID="MinimumAttributeFamilyPercentage" ValidChars="1234567890.">
                            </asp:FilteredTextBoxExtender>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" class="style1" colspan="4">&nbsp;</td>
                    </tr>
                     <tr>
                        <td align="left" class="style1" colspan="3">
                            <asp:Label ID="Label6" runat="server" 
                                Text="Price" />
                        </td>
                        <td align="left" class="style1">
                            <asp:TextBox ID="txtPrice" runat="server" />
                            <asp:FilteredTextBoxExtender ID="txtPrice_FilteredTextBoxExtender" 
                                runat="server" Enabled="True" FilterMode="ValidChars" 
                                TargetControlID="txtPrice" ValidChars="1234567890.">
                            </asp:FilteredTextBoxExtender>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" class="style1" colspan="4">&nbsp;</td>
                    </tr>
                   <tr>
                        <td align="left" class="style1" colspan="3">
                            <asp:Label ID="Label5" runat="server" 
                                Text="Go Via Payment" />
                        </td>
                        <td align="left" class="style1">
                            <asp:CheckBox ID="chkGoViaPayment" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td align="center" class="style1" colspan="4">&nbsp;</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td></td>
                        <td colspan="2" align="center">
                            <asp:Button ID="SaveBtton" runat="server" Text="Save" OnClick="SaveBtton_Click" ValidationGroup="Settings" />
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
        <br />
    </div>
</asp:Content>
